﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%@ Import Namespace="wojilu.Members.Users.Domain" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>#{softtitle}</title>
<link href="#{path.css}ybb/css/baselist.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/all.css?v=#{cssVersion}" rel="stylesheet" type="text/css" />
<link href="#{path.css}ybb/css/formdiv.css?v=#{cssVersion}" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="#{path.js}ybb/js/jquery.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/form.js?v=#{jsVersion}"></script>
<script type="text/javascript" src="#{path.js}ybb/js/control.js?v=#{jsVersion}"></script>
<script type="text/javascript" language="JavaScript">
    var username_empty = "_{management_password_username_empty}";
    var oldpassword_empty = "_{management_password_oldpassword_empty}";
    var newpassword_empty = "_{management_password_newpassword_empty}";
    var newpassword_error = "_{management_password_newpassword_error}";
    var newpassword_username_error = "_{management_password_newpassword_username_error}";
    var newpassword2_empty = "_{management_password_newpassword2_empty}";
    var newpassword3_error = "_{management_password_newpassword3_error}";
    var iframename = "#{iframename}";
    var digheight = "#{digheight}";

$(document).ready(function(){
	var h = parseInt(digheight);
	if(document.getElementById("mainbodybottonauto")){
		$('.managebottonadd').css({height:h-40});
	}
});

function checkpassword() {
	if( mainform.username.value.length<5 ) {
		alert(username_empty)
		document.mainform.username.focus();
		return false;
	}

	if( mainform.password1.value.length<5 ) {
		alert(oldpassword_empty)
		document.mainform.password1.focus();
		return false;
	}

	if( mainform.password.value.length<5 ) {
		alert(newpassword_empty)
		document.mainform.password.focus();
		return false;
	}

	if ( mainform.password.value=="123456" || mainform.password.value=="111111" || mainform.password.value=="aaaaaa" || mainform.password.value=="654321" || mainform.password.value=="abcdef") {
		alert(newpassword_error)
		document.mainform.password.focus();
		return false;
	}

	if ( mainform.username.value==mainform.password.value ){
		alert(newpassword_username_error)
		document.mainform.password.focus();
		return false;
	}

	if( mainform.password2.value =="" ) {
		alert(newpassword2_empty)
		document.mainform.password2.focus();
		return false;
	}
	if( mainform.password2.value != mainform.password.value ) {
		alert(newpassword3_error)
		document.mainform.password.focus();
		return false;
	}
}

function resetwindow(){
    parent.closeifram();
}
</script>
</head>

<body>
<form name="mainform" method="post" action="#{ActionLink}" onSubmit="return checkpassword()">
<input type="hidden" name="digheight" value="#{digheight}"/>
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">_{position_title}</span><span class="padding-left5 colorgorningage">_{management_password_mess}</span></span>
		</div>
        <%User memberinfo = v.data("memberinfo") as User; %>
        <%var errconter = v.data("errconter") as String; %>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtablewin">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">_{management_password_username}</td>
						<td width="85%" class="trtitle02">
						<input type="hidden" name="username" size="20" maxlength="250" value="#{memberinfo.Name}" class="smallInput"/>
						#{memberinfo.Name} [_{management_password_username_mess1}：#{memberinfo.LastLoginTime} &nbsp;_{management_password_username_mess2}：#{memberinfo.LastLoginIp}</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{management_password_password1}</td>
						<td class="trtitle02"><input type="password" name="password1" size="25" maxlength="30" class="infoInput"/> <%if(errconter !=""){ %><span class="cautiontitle2">#{errconter}</span><%} %></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{management_password_password}</td>
						<td class="trtitle02"><input type="password" name="password" size="25" maxlength="30" class="infoInput"/> <span class="cautiontitle">_{management_password_password_mess}</span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{management_password_password2}</td>
						<td class="trtitle02"><input type="password" name="password2" size="25" maxlength="30"  class="infoInput"/> <span class="cautiontitle">_{management_password_password2_mess}</span></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{management_password_name}</td>
						<td class="trtitle02"><input type="text" name="name" size="23" maxlength="20" class="infoInput" value="#{memberinfo.RealName}"/></td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">_{management_password_sex}</td>
						<td class="trtitle02">
                            <input type="radio" value="0" name="sex" <%if(memberinfo.Gender ==0){ %>checked="checked"<%} %>/> 保密&nbsp;
						    <input type="radio" value="1" name="sex" <%if(memberinfo.Gender ==1){ %>checked="checked"<%} %>/> _{select_sex_1}&nbsp;
						    <input type="radio" value="2" name="sex"<%if(memberinfo.Gender ==2){ %>checked="checked"<%} %>/> _{select_sex_0}
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr id="bottonsubmit">
				<td id="right"><input type="submit" name="Submit" value="_{botton_edit}" class="buttonface" title="_{botton_edit}"/></td>
				<td id="left" class="padding-left5"><input type="reset" name="reset" value="_{botton_edit_reset}" onclick="javascript:resetwindow();" class="buttonface"  title="_{botton_edit_reset}"/></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>
